import {createRouter, createWebHistory} from 'vue-router'
import {createApp} from 'vue'
import './style.css'
import App from './App.vue'
import routes from './router'
import naive from 'naive-ui'
// import 'naive-ui/lib/naive-ui.css'
import {createDiscreteApi} from "naive-ui";

const {message, dialog, notification} = createDiscreteApi(['message', 'dialog', 'notification']);
window.$message = message;
window.$dialog = dialog;
window.$notification = notification;

let app: any = null
let router = null
let history: any = null

history = createWebHistory(import.meta.env.BASE_URL)
router = createRouter({
    history,
    routes,
    scrollBehavior: () => ({left: 0, top: 0})
})
app = createApp(App)
app.use(router)
app.use(naive)
app.mount('#app')
// createApp(App).mount('#app')
